<template>
  <div>
    <!-- 面包屑导航栏 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item to="/home/welcome">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 底部内容 -->
    <el-card class="box-card">
      <el-table :data="datalist" border style="width: 100%">
        <el-table-column prop="id" label="#" width="180"></el-table-column>
        <el-table-column prop="authName" label="权限说明" width="180"></el-table-column>
        <el-table-column prop="path" label="对应访问路径"></el-table-column>
        <el-table-column prop="level" label="权限">
          <template slot-scope="scope">
            <el-tag type="primary" v-if="scope.row.level==0">{{"一级"}}</el-tag>
            <el-tag type="success" v-if="scope.row.level==1">{{"二级"}}</el-tag>
            <el-tag type="warning" v-if="scope.row.level==2">{{"三级"}}</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      datalist: []
    };
  },
  mounted() {
    this.getdataList();
  },
  methods: {
    getdataList() {
      this.axios.get("rights/list").then(res => {
        this.datalist = res.data;
      });
    }
  }
};
</script>

<style>
</style>